/**
 * Created by Dalyn on 2017/3/14.
 */
import Relay from "react-relay";

export default class GetManagerListMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { getManagerList }`;
    }

    getVariables() {
        return {
            argsInput: {
                pageNum: this.props.pageNum,
                pageSize: this.props.pageSize
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on getManagerListPayload {
            data {  
                errorCode
                value
                totalResult
                id
                managerList{
                    managerId
                    password
                    name
                    phone
                    status
                    registerDate
                    signDate
                    roleId
                    roleName
                    isSetPassword
                    pid
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on getManagerListPayload {
                    data {
                        errorCode
                        value
                        totalResult
                        id
                        managerList{
                            managerId
                            password
                            name
                            phone
                            status
                            registerDate
                            signDate
                            roleId
                            roleName
                            isSetPassword
                            pid
                        }
                    }
                }
            `]
        }];
    }

}